Int (number)
Basic and Crystal syntax.
Argument
Number value
Returns
Whole number value
Action
Int returns the integer portion of a given number by rounding it down to the next smallest integar.
Examples
The following examples are applicable to both Basic and Crystal syntax:
Int (123.678)
Returns 123.
Int (-123.678)
Returns -124.
Int (-123.1)
Returns -124.
Comments
- This function is designed to work like the Visual Basic function of the same name.
- Fix (n) (or Truncate (n)) and Int (n) are the same except when n is negative, in which case Fix and Truncate return the first integer greater than or equal to n, and Int returns the first integer smaller than or equal to n. For example,
Fix (-10.2)
Truncate (-10.2)
Both return -10.
Int (-10.2)
Returns -11.
Related topics
Fix
Truncate (x), Truncate (x, #places)